home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Data 2004 February / CD Rom Data Şubat 2004.iso / Media / Internet / host-mon.exe / Examples / Scripts / RegRead.js < prev    next >
Encoding:
Text File  |  2002-10-22  |  1.2 KB  |  34 lines

  1. //-----------------------------------------------------------------------------
  2. //File    : RegRead.JS
  3. //Purpose : Sample script test for Advanced Host Monitor
  4. //Comment : Reads registry data. Sets test's status to "Bad" when some 
  5. //          application (or a user) changes address to a web page that Internet 
  6. //          Explorer uses as home page
  7. //Req     : Test's option "Translate macros" must be enabled
  8. //Language: JScript
  9. //Version : 1.0
  10. //Author  : KS-Soft (www.ks-soft.net)
  11. //-----------------------------------------------------------------------------
  12.  
  13. statusAlive       = "Host is alive:"
  14. statusDead        = "No answer:"
  15. statusUnknown     = "Unknown:"
  16. statusNotResolved = "Unknown host:"
  17. statusOk          = "Ok:"
  18. statusBad         = "Bad:"
  19. statusBadContents = "Bad contents:"
  20.  
  21. IEkey = "HKCU\\Software\\Microsoft\\Internet Explorer\\Main\\Start Page"
  22.  
  23. //---- entry point ----
  24.  
  25. function performtest()
  26. {
  27.   if ("%Reply%"=="%"+"Reply"+"%") return statusUnknown+"Please enable 'Translate macros' option";
  28.  
  29.   var WshShell, KeyStr;
  30.   WshShell = new ActiveXObject ("WScript.Shell");
  31.   KeyStr = WshShell.RegRead(IEkey);
  32.   if (KeyStr!="%Reply%") return (statusBad+KeyStr); else return (statusOk+KeyStr);
  33. }
  34.